<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
</head>
<body>
<script>
    var arr1 = [1,2,2,2,3,3,3,4,5,6]
        arr2 =[]
    for(var i = 0; i< arr1.length; i++){
        if(arr2.indexOf(arr1[i])<0){
            arr2.push(arr1[i])
        }
    }
    document.write(arr2)
</script>

</body>
</html>